<template>
  <div id="survey">  
    <el-form ref="form" :model="form" label-width="80px">  
     <el-row> 
        <el-col :span="20" style="display:flex;">
             <div style="line-height: 40px;font-weight:bold:">数据概况</div>
            <el-form-item label="" label-width="0px" style="margin-left:10px;">           
                    <el-date-picker 
                      :picker-options="pickerOptions" @change="select_change" type="date"  placeholder="开始日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd"  v-model="form.time" style="width:150px;"></el-date-picker>             
            </el-form-item>
        </el-col> 
        <el-col :span="4" style="text-align: center;display: flex;justify-content: flex-end;">
          <div class="see_but" >查看详情</div>
        </el-col> 
    </el-row> 
   
   </el-form>

   <survey-list :datalist="datalist" @up_list_fun="list_fun"> </survey-list>

  </div>
</template>

<script>


import SurveyList from '@/view/Operationdata/Analysis/SurveyList'
export default {
  name: 'survey',
  data () {
    return {
       pickerOptions: { // 计费日期的约束条件
        disabledDate(time) {
          
            return   time.getTime() < new Date('2021-02-03').getTime() 
            }
      },
        datalist:[],

        form:{
            time:'',
        },
    }
  },
   components:{
      SurveyList,
  },
  created(){
      // this.form.time = this.getNowDate1()
       this.list_fun()
       
  },
  mounted (){
      
  },
  methods: {
    list_fun(){
        this.post("/early_warn/survey", {
              onetime:this.form.time,
	         }).then(res => {
            this.datalist = res.result
            console.log(res,"dsad")
          })
    },
    select_change(){
        this.list_fun()
    },
  }
}
</script>


<style scoped>
.see_but{
    width: 90px;
    height: 30px;
    background: #B3C0D1;
    border-radius: 18px;
    text-align: center;
    line-height: 30px;
    color:white;
    font-size: 14px;
    cursor: pointer;
}
</style>
